3.4.48 \(\int \frac {A+B x}{\sqrt {x} (a+b x)} \, dx\) [348]

Optimal. Leaf size=49 \[ \frac {2 B \sqrt {x}}{b}+\frac {2 (A b-a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}} \]

[Out]

2*(A*b-B*a)*arctan(b^(1/2)*x^(1/2)/a^(1/2))/b^(3/2)/a^(1/2)+2*B*x^(1/2)/b

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {81, 65, 211} \begin {gather*} \frac {2 (A b-a B) \text {ArcTan}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}+\frac {2 B \sqrt {x}}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*x)/(Sqrt[x]*(a + b*x)),x]

[Out]

(2*B*Sqrt[x])/b + (2*(A*b - a*B)*ArcTan[(Sqrt[b]*Sqrt[x])/Sqrt[a]])/(Sqrt[a]*b^(3/2))

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 81

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin {align*} \int \frac {A+B x}{\sqrt {x} (a+b x)} \, dx &=\frac {2 B \sqrt {x}}{b}+\frac {\left (2 \left (\frac {A b}{2}-\frac {a B}{2}\right )\right ) \int \frac {1}{\sqrt {x} (a+b x)} \, dx}{b}\\ &=\frac {2 B \sqrt {x}}{b}+\frac {\left (4 \left (\frac {A b}{2}-\frac {a B}{2}\right )\right ) \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\sqrt {x}\right )}{b}\\ &=\frac {2 B \sqrt {x}}{b}+\frac {2 (A b-a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 49, normalized size = 1.00 \begin {gather*} \frac {2 B \sqrt {x}}{b}-\frac {2 (-A b+a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{\sqrt {a} b^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x)/(Sqrt[x]*(a + b*x)),x]

[Out]

(2*B*Sqrt[x])/b - (2*(-(A*b) + a*B)*ArcTan[(Sqrt[b]*Sqrt[x])/Sqrt[a]])/(Sqrt[a]*b^(3/2))

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 40, normalized size = 0.82

method result size
derivativedivides \(\frac {2 B \sqrt {x}}{b}+\frac {2 \left (A b -B a \right ) \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{b \sqrt {a b}}\) \(40\)
default \(\frac {2 B \sqrt {x}}{b}+\frac {2 \left (A b -B a \right ) \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{b \sqrt {a b}}\) \(40\)
risch \(\frac {2 B \sqrt {x}}{b}+\frac {2 \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right ) A}{\sqrt {a b}}-\frac {2 \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right ) B a}{b \sqrt {a b}}\) \(53\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)/(b*x+a)/x^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*B*x^(1/2)/b+2*(A*b-B*a)/b/(a*b)^(1/2)*arctan(b*x^(1/2)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 39, normalized size = 0.80 \begin {gather*} \frac {2 \, B \sqrt {x}}{b} - \frac {2 \, {\left (B a - A b\right )} \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(b*x+a)/x^(1/2),x, algorithm="maxima")

[Out]

2*B*sqrt(x)/b - 2*(B*a - A*b)*arctan(b*sqrt(x)/sqrt(a*b))/(sqrt(a*b)*b)

________________________________________________________________________________________

Fricas [A]
time = 1.16, size = 102, normalized size = 2.08 \begin {gather*} \left [\frac {2 \, B a b \sqrt {x} + {\left (B a - A b\right )} \sqrt {-a b} \log \left (\frac {b x - a - 2 \, \sqrt {-a b} \sqrt {x}}{b x + a}\right )}{a b^{2}}, \frac {2 \, {\left (B a b \sqrt {x} + {\left (B a - A b\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b}}{b \sqrt {x}}\right )\right )}}{a b^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(b*x+a)/x^(1/2),x, algorithm="fricas")

[Out]

[(2*B*a*b*sqrt(x) + (B*a - A*b)*sqrt(-a*b)*log((b*x - a - 2*sqrt(-a*b)*sqrt(x))/(b*x + a)))/(a*b^2), 2*(B*a*b*
sqrt(x) + (B*a - A*b)*sqrt(a*b)*arctan(sqrt(a*b)/(b*sqrt(x))))/(a*b^2)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 180 vs. \(2 (46) = 92\).
time = 0.53, size = 180, normalized size = 3.67 \begin {gather*} \begin {cases} \tilde {\infty } \left (- \frac {2 A}{\sqrt {x}} + 2 B \sqrt {x}\right ) & \text {for}\: a = 0 \wedge b = 0 \\\frac {2 A \sqrt {x} + \frac {2 B x^{\frac {3}{2}}}{3}}{a} & \text {for}\: b = 0 \\\frac {- \frac {2 A}{\sqrt {x}} + 2 B \sqrt {x}}{b} & \text {for}\: a = 0 \\\frac {A \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{b \sqrt {- \frac {a}{b}}} - \frac {A \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{b \sqrt {- \frac {a}{b}}} - \frac {B a \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{b^{2} \sqrt {- \frac {a}{b}}} + \frac {B a \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{b^{2} \sqrt {- \frac {a}{b}}} + \frac {2 B \sqrt {x}}{b} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(b*x+a)/x**(1/2),x)

[Out]

Piecewise((zoo*(-2*A/sqrt(x) + 2*B*sqrt(x)), Eq(a, 0) & Eq(b, 0)), ((2*A*sqrt(x) + 2*B*x**(3/2)/3)/a, Eq(b, 0)
), ((-2*A/sqrt(x) + 2*B*sqrt(x))/b, Eq(a, 0)), (A*log(sqrt(x) - sqrt(-a/b))/(b*sqrt(-a/b)) - A*log(sqrt(x) + s
qrt(-a/b))/(b*sqrt(-a/b)) - B*a*log(sqrt(x) - sqrt(-a/b))/(b**2*sqrt(-a/b)) + B*a*log(sqrt(x) + sqrt(-a/b))/(b
**2*sqrt(-a/b)) + 2*B*sqrt(x)/b, True))

________________________________________________________________________________________

Giac [A]
time = 0.97, size = 39, normalized size = 0.80 \begin {gather*} \frac {2 \, B \sqrt {x}}{b} - \frac {2 \, {\left (B a - A b\right )} \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/(b*x+a)/x^(1/2),x, algorithm="giac")

[Out]

2*B*sqrt(x)/b - 2*(B*a - A*b)*arctan(b*sqrt(x)/sqrt(a*b))/(sqrt(a*b)*b)

________________________________________________________________________________________

Mupad [B]
time = 0.36, size = 37, normalized size = 0.76 \begin {gather*} \frac {2\,B\,\sqrt {x}}{b}+\frac {2\,\mathrm {atan}\left (\frac {\sqrt {b}\,\sqrt {x}}{\sqrt {a}}\right )\,\left (A\,b-B\,a\right )}{\sqrt {a}\,b^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x)/(x^(1/2)*(a + b*x)),x)

[Out]

(2*B*x^(1/2))/b + (2*atan((b^(1/2)*x^(1/2))/a^(1/2))*(A*b - B*a))/(a^(1/2)*b^(3/2))

________________________________________________________________________________________